<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:comps="http://java.sun.com/jsf/composite/components">
	
<h:panelGroup id="navegacao" layout="block">

	<p:panel id="navegacaoAutorBio" styleClass="panelNavegacao">
				
		<f:facet name="header">
			<h:outputText value="#{locale['blog.biografia.titulo']}" />
		</f:facet>
				
		<h:panelGrid columns="1">
			
			<h:form>
				<p:commandLink id="exibirPerfilLink"
					styleClass="acesseOficial"
					action="#{PerfilBean.exibirPerfil(BlogBean.blog.dono)}">
					<h:outputText value="#{BlogBean.blog.dono.nome}" />
				</p:commandLink>
			</h:form>
			<h:outputText value="#{BlogBean.blog.dono.biografia}" />
					
		</h:panelGrid>
				
	</p:panel>
	
	<p:panel id="navegacaoPesquisa" styleClass="panelNavegacao">
	
		<f:facet name="header">
			<h:outputText value="#{locale['blog.pesquisa.titulo']}" />
		</f:facet>
		
		<h:form id="pesquisaForm">
		
			<h:panelGrid columns="2">
			
				<p:outputLabel for="tituloPesquisar" value="#{locale['blog.pesquisa.label.titulo']}" />
				<p:spacer width="2" />
				<p:inputText id="tituloPesquisar"
					value="#{BlogBean.tituloPostPesquisar}"
					size="33" />
				<p:spacer width="2" />
				
				<p:outputLabel for="conteudoPesquisar" value="#{locale['blog.pesquisa.label.conteudo']}" />
				<p:spacer width="2" />
				<p:inputText id="conteudoPesquisar"
					value="#{BlogBean.conteudoPostPesquisar}"
					size="33" />
				<p:spacer width="2" />
				
				<h:panelGroup layout="block" style="text-align: right;">				
					<p:commandButton id="pesquisarBtn"
						icon="ui-icon-search"
						value="#{locale['blog.pesquisa.titulo']}"
						action="#{BlogBean.pesquisarPost()}"
						ajax="false" />
				</h:panelGroup>
				
			</h:panelGrid>
						
		</h:form>
	
	</p:panel>
	
	<p:panel id="navegacaoPaginas" styleClass="panelNavegacao">
			
		<f:facet name="header">
			<h:outputText value="#{locale['blog.paginas.titulo']}" />
		</f:facet>
		
		<h:form id="navegacaoPaginasForm">
			
			<ui:repeat var="pagina" value="#{BlogBean.customPages}">
					
				<h:panelGroup layout="block" styleClass="navegacaoLink">
					<h:commandLink id="acessarPostBtn"
						action="#{BlogBean.exibirCustomPage(pagina)}"
						ajax="false">
						<h:outputText value="#{pagina.titulo}" />
					</h:commandLink>
				</h:panelGroup>
					
			</ui:repeat>
				
		</h:form>		
			
	</p:panel>
			
	<p:panel id="navegacaoArquivos" styleClass="panelNavegacao">
			
		<f:facet name="header">
			<h:outputText value="#{locale['blog.arquivos.titulo']}" />
		</f:facet>
			
		<h:form id="navegacaoPostForm">
			
			<ui:repeat var="post" value="#{BlogBean.posts}">
					
				<h:panelGroup layout="block" styleClass="navegacaoLink">
					<h:commandLink id="acessarPostBtn"
						action="#{BlogBean.exibirPost(post)}"
						ajax="false">
						<h:outputText value="#{post.titulo}" />
					</h:commandLink>
				</h:panelGroup>
					
			</ui:repeat>
				
		</h:form>
			
	</p:panel>
		
</h:panelGroup>

<comps:DialogPerfil 
	id="perfilDialogo"
	widgetVar="perfilDlg" 
	email="#{PerfilBean.usuario.email}" 
	nome="#{PerfilBean.usuario.nome}" 
	avatar="#{PerfilBean.usuario.avatar}"
	sexo="#{PerfilBean.usuario.sexo}"
	biografia="#{PerfilBean.usuario.biografia}"
	local="#{PerfilBean.usuario.local}"
	dataNascimento="#{PerfilBean.usuario.dataNascimento}"
	dataCadastro="#{PerfilBean.usuario.dataCadastro}">
</comps:DialogPerfil>
	
</ui:composition>